BEGIN
	EXEC qa_drop_table FileRunHistory
END 


CREATE TABLE [dbo].[FileRunHistory](
	[FIleRunID] [bigint] IDENTITY(1,1) NOT NULL,
	[RunDate] [datetime] NOT NULL,
	[FileID] [bigint] NULL,
	[FileSetID] [bigint] NULL,
	[Comment] [nchar](100) NULL,
 CONSTRAINT [PK_FileRunHistory] PRIMARY KEY CLUSTERED 
(
	[FIleRunID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[FileRunHistory]  WITH CHECK ADD  CONSTRAINT [FK_FileRun_FileDefinition] FOREIGN KEY([FileID])
REFERENCES [dbo].[FileDefinition] ([FileID])
GO

ALTER TABLE [dbo].[FileRunHistory] CHECK CONSTRAINT [FK_FileRun_FileDefinition]
GO

ALTER TABLE [dbo].[FileRunHistory]  WITH CHECK ADD  CONSTRAINT [FK_FileRunHistory_FileSet] FOREIGN KEY([FileSetID])
REFERENCES [dbo].[FileSet] ([FileSetID])
GO

ALTER TABLE [dbo].[FileRunHistory] CHECK CONSTRAINT [FK_FileRunHistory_FileSet]
GO

